package maitaole.result;

import java.io.Serializable;
import java.util.List;

/**
 * @Author 李杰
 * @Description 类的功能描述
 * @Date 2023/4/27
 */
public class Result<T> implements Serializable {

    boolean state;
    Integer code;
    String msg;

    T t;
    List<T> listResult;

    public Result(ResultEnum resultEnum) {
        this.state = resultEnum.state;
        this.code = resultEnum.code;
        this.msg = resultEnum.msg;
    }

    public Result(ResultEnum resultEnum, T t) {
        this.state = resultEnum.state;
        this.code = resultEnum.code;
        this.msg = resultEnum.msg;
        this.t = t;
    }
    public Result(ResultEnum resultEnum, List<T> listResult) {
        this.state = resultEnum.state;
        this.code = resultEnum.code;
        this.msg = resultEnum.msg;
        this.listResult = listResult;
    }

    @Override
    public String toString() {
        return "Result{" +
                "state=" + state +
                ", code=" + code +
                ", msg='" + msg + '\'' +
                ", t=" + t +
                ", listResult=" + listResult +
                '}';
    }
}

